import Vue from 'vue'
import VueRouter from 'vue-router'
import Reg from '../pages/elementui/Reg.vue'
import Login from '../pages/elementui/Login.vue'
import Manage from '../pages/elementui/Manage.vue'

import Student from '../pages/Student.vue'
import Teacher from '../pages/Teacher.vue'
import Cls from '../pages/Class.vue'

import Test from '../pages/Test.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/test',
    name: 'test',
    component: Test
  },
  {
    path: '/',
    name: 'reg',
    component: Reg
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/manage',
    name: 'manage',
    component: Manage,
    children:[
      {
        path: 'student',
        component: Student
      },
      {
        path: 'teacher',
        component: Teacher
      },
      {
        path: 'class',
        component: Cls
      }
    ]
  }
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
